﻿CREATE PROCEDURE [dbo].[thuan_qtxoamenu]    
@ID as int    
AS    
declare @dem as int     
select @dem=COUNT(*) from DanhMuc_Menu where MenuID=@ID     
if(@dem >0)    
begin    
if not exists(select * from QuanTri_PhanNhomMenu Where MenuCha=@ID)
begin
delete from DanhMuc_Menu where MenuID=@ID    
select ErrCode=1 
end
else
begin
select ErrCode=0
end   
end    
else    
begin    
select ErrCode=0    
end  